#define _CRT_SECURE_NO_WARNINGS 1
#include"SeqList.h"

void TestSeqList1()
{
	SL s;
	SLInit(&s);
	SLPushBack(&s, 1);
	SLPushBack(&s, 2);
	SLPushBack(&s, 3);
	SLPushBack(&s, 4);
	SLPushBack(&s, 5);
	SLPushBack(&s, 6);
	SLPrint(&s);
	SLPopBack(&s);
	SLPopBack(&s);
	SLPrint(&s);
	SLDestroy(&s);

}

TestSeqList2()
{
	SL s;
	SLInit(&s);
	SLPushFront(&s,1);
	SLPushFront(&s, 2);
	SLPushFront(&s, 3);
	SLPushFront(&s, 4);
	SLPushFront(&s, 5);
	SLPrint(&s);
	SLPopFront(&s);
	SLPrint(&s);
	SLPopFront(&s);
	SLPrint(&s);
	SLDestroy(&s);
}

TestSeqList3()
{
	SL s;
	SLInit(&s);
	SLInsert(&s,0, 0);
	SLInsert(&s, 1, 10);
	SLInsert(&s, 2, 4);
	SLInsert(&s, 3, 54);
	SLInsert(&s, 4, 984);
	SLPrint(&s);
	int ret=SLFind(&s, 4);
	printf("%d\n", ret);
	SLErase(&s, 4);
	SLErase(&s, 0);
	SLPrint(&s);
	SLDestroy(&s);
}

int main()
{
	TestSeqList1();
	printf("\n");
	TestSeqList2();
	printf("\n");
	TestSeqList3();
	return 0;
}
